<template>
  <div class="salarys-container">
    <div class="app-container">
      <el-card>
        <template>
          <div class="department-container">
            <div class="app-container">
              <el-card>
                <!-- 用一个行列布局 -->
                <el-row type="flex" justify="space-between" align="middle" style="height: 40px">
                  <el-col :span="20">
                    <svg-icon icon-class="home" /><span>江苏传智播客教育科技股份有限公司</span>
                  </el-col>
                  <el-col :span="4">
                    <el-row type="flex" justify="end">
                      <!-- 两个内容 -->
                      <el-col>负责人</el-col>
                      <!-- 下拉菜单 element -->
                      <el-col>
                        <el-dropdown>
                          <span>
                            操作<i class="el-icon-arrow-down" />
                          </span>
                          <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item>添加子部门</el-dropdown-item>
                          </el-dropdown-menu>
                        </el-dropdown>
                      </el-col>
                    </el-row>
                  </el-col>
                </el-row>

                <el-tree
                  :data="data"
                  :default-expand-all="true"
                  :props="{
                    children:'children',
                    label:'name'
                  }"
                >
                  <el-row type="flex" justify="space-between" align="middle" style="height: 40px;width:100%">
                    <el-col :span="20">
                      <svg-icon icon-class="home" /><span>江苏传智播客教育科技股份有限公司</span>
                    </el-col>
                    <el-col :span="4">
                      <el-row type="flex" justify="end">
                        <!-- 两个内容 -->
                        <el-col>负责人</el-col>
                        <!-- 下拉菜单 element -->
                        <el-col>
                          <el-dropdown>
                            <span>
                              操作<i class="el-icon-arrow-down" />
                            </span>
                            <el-dropdown-menu slot="dropdown">
                              <el-dropdown-item>添加子部门</el-dropdown-item>
                            </el-dropdown-menu>
                          </el-dropdown>
                        </el-col>
                      </el-row>
                    </el-col>
                  </el-row>
                </el-tree>
              </el-card>
            </div>
          </div>
        </template>
      </el-card>
    </div>
  </div>

</template>

<script>
export default {
  data() {
    return {
      data: [{
        name: '一级 1',
        children: [{
          name: '二级 1-1',
          children: [{
            name: '三级 1-1-1'
          }]
        }]
      },
      {
        name: '一级 2',
        children: [{
          name: '二级 2-1',
          children: [{
            name: '三级 2-1-1'
          }]
        },
        {
          name: '二级 2-2',
          children: [{
            name: '三级 2-2-1'
          }]
        }]
      },
      {
        name: '一级 3',
        children: [{
          name: '二级 3-1',
          children: [{
            name: '三级 3-1-1'
          }]
        },
        {
          name: '二级 3-2',
          children: [{
            name: '三级 3-2-1'
          }]
        }]
      }]

    }
  },
  methods: {
    handleNodeClick(data) {
      console.log(data)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
